﻿namespace Library.OrmEnterpriseEntity.TableInfo {
	/// <summary>
	/// The state of Global entity
	/// </summary>
	public enum EntityState {
		/// <summary>
		/// the entity exist in application only, not exist in database yet
		/// </summary>
		New = 1,
		/// <summary>
		/// The application entity is inserted in Sql transaction, this state will be changed to DbNoChange after transaction was commited, or changed to New state if transaction was rollbacked
		/// </summary>
		Inserting = 2,
		/// <summary>
		/// The state tells entity data and database data is at the same
		/// </summary>
		DbNoChange = 3,
		/// <summary>
		/// The application entity data is saving to database in Sql transaction, the state will be changed to DbNoChange after transasction was commited, or changed to DbChange state if transaction was rollbacked
		/// </summary>
		Updating = 4,
		/// <summary>
		/// The state tells entity data and database data is different
		/// </summary>
		DbChange = 5,
		/// <summary>
		/// The database entity is deleting in Sql transaction, the state will changed to preview state (state before delete) if transasction was rollbacked, to changed to Delete if transasction was commited
		/// </summary>
		Deleting = 6,
		/// <summary>
		/// The state tell database entity id deleted
		/// </summary>
		Delete = 7
	}
}
